/*
 * XercesTypeDefinition.java
 *
 * Created on June 13, 2005, 10:50 AM
 *
 * (C) R. Alexander Milowski alex@milowski.com
 */

package org.infoset.xml.xerces;

import java.net.URI;
import org.infoset.xml.*;
import org.apache.xerces.xs.*;

/**
 *
 * @author R. Alexander Milowski
 */
public class XercesTypeDefinition implements TypeDefinition
{
   
   Name name;
   XSTypeDefinition def;
   
   /** Creates a new instance of XercesTypeDefinition */
   public XercesTypeDefinition(XSTypeDefinition def)
   {
      this.def = def;
      String nsString = def.getNamespace();
      URI ns = nsString==null ? Name.NO_NAMESPACE : URI.create(nsString);
      this.name = new Name(ns,def.getName());
   }
   
   public Name getName()
   {
      return name;
   }
   
   public XSTypeDefinition getXercesDefinition() {
      return def;
   }
   
}
